package com.shanhesoft.java.modules.exam.util;

import com.shanhesoft.java.common.rancher.Rancher;

public class RancherUtils {
	
	private static class SingletonClassInstance{
		private static final String server = PropertiesUtils.getProperty("rancher.server");
		private static String api_v2 = PropertiesUtils.getProperty("rancher.server.v2");
		private static final String accessKey = PropertiesUtils.getProperty("rancher.accessKey");
		private static final String secretKey =PropertiesUtils.getProperty("rancher.secretKey");
		private static final Rancher.Config config = new Rancher.Config(server,accessKey, secretKey);
		private static final Rancher rancher = new Rancher(config);
		private static final Rancher.Config config_v2 = new Rancher.Config(api_v2,accessKey, secretKey);
		private static final Rancher rancher_v2 = new Rancher(config_v2);
	}

	public static Rancher getInstance() {
		return SingletonClassInstance.rancher;
	}
	
	public static Rancher getInstanceV2() {
		return SingletonClassInstance.rancher_v2;
	}
}
